1. Field of the Invention
The present invention relates generally to graphical user interfaces, and in particular, to a method, apparatus, and article of manufacture for providing event handlers for shape objects with authorable behaviors and appearances.
2. Description of the Related Art
The use of Computer Assisted Drafting (CAD) application programs is well known in the art. Some CAD programs provide templates and palettes that help users create documents, graphical presentations, etc. However, these templates and palettes provide only limited assistance and do little to help the user connect standard CAD components, define new components, or define methods of manipulating the components within the CAD program.
Most standard components are predefined by the CAD program itself, leaving little room for the user to define custom shapes without using the predefined standard components as building blocks. A user must manipulate standard components to define a shape or outline, place them spatially proximate on a working screen, and then group them together using a grouping or wrapping function.
This multiple step approach of dragging components onto the screen and then modifying the components to create a new shape or outline within a document is inefficient and time consuming. Further, the process is not easily learned by a user, and makes it difficult to create shapes that are shared between users. Further, these limitations prevent many users from utilizing the CAD program to its fullest extent.
Many shapes also require the ability to change in conjunction with other shapes, e.g., when another shape is stretched, each shape associated with that shape must stretch in proportion to the stretched shape. Expressions that define properties in terms of other properties, or constraints that describe relationships between two or more geometric objects are common mechanisms for handling dependencies of this sort. However, expressions and constraints have limited ability to modify the form of a shape, or execute complex actions. For example, if a wall shape is made small enough, then a window shape attached to the wall shape may need to delete itself. A complex shape may also want to respond to stimuli other than a change to a shape. For example, a shape representing a file cabin et may want to redraw itself as xe2x80x9copenxe2x80x9d when the end user clicks on the shape with a pointing device.
Anticipating all of the possible behaviors of a shape is not possible. As such, the shape author needs a flexible mechanism for associating executable code, called an event handler, with a shape and controlling the execution of the code.
Consequently, there is a need in the art for improved techniques for creating components in a CAD program, in order to create documents faster. Further, there is a need in the art for improved techniques for creating components in a CAD program that eliminate the need for accessing toolbar or menu functions. There is also a need for components that can dynamically change with drawing conditions.
To address the requirements described above, the present invention discloses a method, apparatus, and article of manufacture for creating a shape to display information on a monitor of a computer. The method comprises the steps of creating a spatial frame of the shape wherein the spatial frame provides a mapping function for the shape and provides a geometric framework for the shape, creating at least one event handler of the shape, coupling the event handler to the shape, and using the event handler coupled to the shape to display desired information on the monitor.